package notes.java.sjms23.s5_command;
// 命令发送器
public class PlayerInvoker {

    private TurnOnCommand turnOnCommand;
    private TurnOffCommand turnOffCommand;
    private NextCommand nextCommand;

    public PlayerInvoker(TurnOnCommand turnOnCommand, TurnOffCommand turnOffCommand, NextCommand nextCommand) {
        this.turnOnCommand = turnOnCommand;
        this.turnOffCommand = turnOffCommand;
        this.nextCommand = nextCommand;
    }

    public void turnOn() {
        this.turnOnCommand.execute();
    }

    public void turnOff() {
        this.turnOffCommand.execute();
    }

    public void next() {
        this.nextCommand.execute();
    }
}